<!DOCTYPE html>
<html>
<head>
	<title>操作日志</title>
    <include file='public/head'>
        <style>
			.layui-legend-size{font-size:14px !important;}
			.layui-nopadding{padding:0 !important;}
			.layui-overflow{overflow:auto;}
			.layui-nomargin{margin: 0 !important;}
			.layui-bottom{border-bottom:1px solid rgb(226, 226, 226);}
			.layui-input{height:30px !important; }
			.layui-form-search-item .layui-inline{margin-bottom: 5px;} 
			.layui-form-search-item label{margin-left: 15px;}
			.layui-table-page {padding: 7px 0px 0px;}
			.layui-field-padding{border-width: 1px;padding:0 0 5px 10px;}
        </style>
</head>
<body>
	<!-- layui-tab开始 -->
	<div class="layui-tab" lay-filter="demo-tab" >
		<!-- 顶部导航菜单开始 -->
		<div class="layui-tab-nav">
			<ul class="layui-tab-title">
				{:getNav('log','admin_index/index')}
			</ul>
		</div>	
		<!-- 顶部导航菜单结束 -->

		<!-- 搜索栏开始 -->
		<fieldset class="layui-elem-field layui-field-title layui-field-padding">
			<legend class="layui-legend-size">搜索</legend>
			<form class="layui-form table-bar" action="{:cmf_plugin_url('Log://admin_index/index')}" lay-filter="form-bar">

				<div  class="layui-form-search-item">
					<label>时间</label>
					<div class="layui-inline">
						<div class="layui-input-inline">
							<input type="text" name="start_time" class="layui-input" id="test1" style="width: 150px;" value="{$search['start_time']}"  autocomplete="off">
						</div>
						至
						<div class="layui-input-inline">
							<input type="text"  name="end_time" class="layui-input" id="test2" style="width: 150px;" value="{$search[ 'end_time' ]}" autocomplete="off">
						</div>
					</div>

					<div class="layui-inline">
						<button type="submit" class="layui-btn layui-btn-sm layui-btn-primary " style="font-weight:800;" lay-submit="" lay-filter="demo2"><i class="layui-icon ">&#xe615;</i>搜索</button>
					</div>

				</div>
			</form>
		</fieldset>
		<!-- 搜索栏结束 -->

		<!-- 内容开始 -->
		<form  class="layui-form" action="">

			<!-- 数据表格开始 -->
			<table  class="layui-table layui-nomargin">
						<thead>	
							<tr>
							    <th>序号</th>
								<th>地址</th>
								<th>ip</th>
								<th>发生时间</th>
								<th>事件</th>
								<th>请求状态</th>
								<th>用户类型</th>
								<th>用户id</th>
								<th>详情</th>
							</tr>
						</thead>
						<tbody >
							<volist name ="list" id="vo">
								<tr lay-filter="test3">
								    <td>{$key+1}</td>
									<td>{$vo.rule_name}</td>
									<td>{$vo.client_ip}</td>
									<td>{$vo.add_time}</td>
									<td>{$vo.event}</td>
									<td>{$vo.status_text}</td>
									<td>{$vo.user_type}</td>
									<td>{$vo.uid_text}</td>
									<td data-cls="xx-{$vo.id}">
									    <button type="button"  class="layui-btn layui-btn-xs xiangqing">详情</button>
									</td>
								</tr>
								<div class="xx-{$vo.id}" style="display:none;">
								    <div style="padding:15px;">
								        <fieldset class="layui-elem-field layui-field-title layui-field-padding">
                                            <legend class="layui-legend-size">地址</legend>
                                                <p style="word-break: break-all;">
	                                                <?php 
	                                                	if( $vo [ 'rule_name' ]){ 
		                                                	echo htmlentities($vo [ 'rule_name' ]);
		                                                }else { 
		                                                	echo '无';
		                                            	}
	                                            	?>
	                                            </p>
                                        </fieldset>
                                        <fieldset class="layui-elem-field layui-field-title layui-field-padding">
                                            <legend class="layui-legend-size">事件</legend>
                                                <p style="word-break: break-all;">
	                                                <?php 
	                                                	if( $vo [ 'event' ]){ 
		                                                	echo htmlentities($vo [ 'event' ]);
		                                                }else { 
		                                                	echo '无';
		                                            	}
	                                            	?>
	                                            </p>
                                        </fieldset>
                                        <fieldset class="layui-elem-field layui-field-title layui-field-padding">
                                            <legend class="layui-legend-size">参数</legend>
                                            	<p style="word-break: break-all;">
                                                	<?php 
	                                                	if( $vo [ 'params' ]){ 
		                                                	echo htmlentities($vo [ 'params' ]);
		                                                }else { 
		                                                	echo '无';
		                                            	}
	                                            	?>
                                                </p>
                                        </fieldset>
                                        <fieldset class="layui-elem-field layui-field-title layui-field-padding">
                                            <legend class="layui-legend-size">备注信息</legend>
                                                <p style="word-break: break-all;">
                                                	<?php 
	                                                	if( $vo [ 'rk' ]){ 
		                                                	echo htmlentities($vo [ 'rk' ]);
		                                                }else { 
		                                                	echo '无';
		                                            	}
	                                            	?>
                                                </p>
                                        </fieldset>
			                        </div>
								</div>
							</volist>
						</tbody>
					</table>
			<!-- 数据表格结束 -->
             <!-- 分页开始 -->

                <div class="layui-table-page">

                    <div id="layui-table-page1">

                        <div class="layui-box layui-laypage layui-laypage-default" id="layui-laypage-1">

                            {$list->render([10,20,30,50,100,500])|default=''}

                        </div>

                    </div>

                </div>

                <!-- 分页结束 -->


		
			<!-- toolbar - 工具条模板结束 -->
		</form>
		<!-- 内容结束 -->
	</div>
	<!-- layui-tab结束-->

	<include file='public/scripts'>

	<!-- script开始-->	
	<script>
	;!function(){
		var form = layui.form
			,layer = layui.layer    //弹出层必需
			,layedit = layui.layedit  //富文本必需
			,laydate = layui.laydate  //日期选择必需
			,table = layui.table  //表格必需
			,element = layui.element;  //选项卡	
			
		//日期选择器	   
    	laydate = layui.laydate;
    	laydate.render({
    		elem: '#test1' //指定元素
    		,type:"datetime"
    	});
    	laydate.render({
    		elem: '#test2' //指定元素
    		,type:"datetime"
    	});
    	
    	//捕获页
    	$(document).on( 'click' , '.xiangqing' , function(){
    	    
    	    let classs = $( this ).parents('td').data( 'cls' );
    	    layer.open({
                type: 1,
                area: ['80%', '80%'], //宽高
                skin: 'layui-layer-rim', //加上边框
                shade: false,
                title: false, //不显示标题
                content: $( '.'+classs ), //捕获的元素，注意：最好该指定的元素要存放在body最外层，否则可能被其它的相对元素所影响
            });
    	} );

        
    	
    	
    	
    	
	}();


	</script>
	<!-- script结束-->

</body>
</html>